package com.light.lallalalalal;

import org.anddev.andengine.engine.Engine;
import org.anddev.andengine.engine.camera.Camera;
import org.anddev.andengine.engine.options.EngineOptions;
import org.anddev.andengine.engine.options.EngineOptions.ScreenOrientation;
import org.anddev.andengine.engine.options.resolutionpolicy.RatioResolutionPolicy;
import org.anddev.andengine.entity.scene.Scene;
import org.anddev.andengine.entity.scene.background.ColorBackground;
import org.anddev.andengine.extension.physics.box2d.PhysicsWorld;
import org.anddev.andengine.opengl.texture.Texture;
import org.anddev.andengine.opengl.texture.region.TextureRegion;
import org.anddev.andengine.ui.activity.BaseGameActivity;

import android.hardware.SensorManager;

import com.badlogic.gdx.math.Vector2;

public class LightoneloveActivity extends BaseGameActivity {

	private static final int CAMERA_WIDTH = 720;
	private static final int CAMERA_HEIGHT = 480;
	private Camera mCamera;
	
	public Picture picture;
	public Texture texture;
	public TextureRegion textureRegion;
	public MyPhysicsWorld physicsWorld;
	
	@Override
	public Engine onLoadEngine() {
		this.mCamera = new Camera(0, 0, CAMERA_WIDTH, CAMERA_HEIGHT);
		EngineOptions tempEO = new EngineOptions(true, 
				ScreenOrientation.LANDSCAPE, 
				new RatioResolutionPolicy(CAMERA_WIDTH, CAMERA_HEIGHT), 
				this.mCamera);
		
		
		picture = new Picture(this);
		picture.onLoadEngine();
		
		return new Engine(tempEO);
	}

	@Override
	public void onLoadResources() {
		picture.onLoadResource();
	}

	@Override
	public Scene onLoadScene() {
		Scene scene = new Scene(1);
		physicsWorld = new MyPhysicsWorld(new Vector2(0, SensorManager.GRAVITY_EARTH), false);
		
		scene.setBackground(new ColorBackground(0.3f, 0.4f, 0.5f));
		scene.registerUpdateHandler(physicsWorld);
		picture.onLoadScene(scene, physicsWorld);
		return scene;
	}

	@Override
	public void onLoadComplete() {
		// TODO Auto-generated method stub
		
	}
}